package com.at.lmm.provider.service;

import com.at.lmm.entiy.UserInfo;
import com.at.lmm.service.UserService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.HashMap;
import java.util.Map;
@DubboService
public class UserServiceImpl implements UserService {
    private static final Map<Long,UserInfo> userList = new HashMap<>();
    static {
        UserInfo userInfo1 = UserInfo.builder().id(1L).userName("张三").password("123456").build();
        UserInfo userInfo2 = UserInfo.builder().id(2L).userName("王五").password("123456").build();
        UserInfo userInfo3 = UserInfo.builder().id(3L).userName("李帅").password("123456").build();
        userList.put(userInfo1.getId(),userInfo1);
        userList.put(userInfo2.getId(),userInfo2);
        userList.put(userInfo3.getId(),userInfo3);
    }
    @Override
    public UserInfo getUserById(Long id) {
        return userList.get(id);
    }
}
